package org.price.sql.repo.session;

import java.security.Permission;
import java.security.Principal;
import java.util.Enumeration;
import java.util.List;
import java.util.Map;

import org.price.sql.repo.document.model.Document;
import org.price.sql.repo.exceptions.SessionException;
import org.price.sql.repo.session.tx.Transaction;

public interface Session {
    public void login() throws SecurityException;

    public Transaction newTransaction() throws SessionException;

    public List<Principal> getPrincipals();

    public Map<String, Object> getLockInfo(Document doc);

    public Enumeration<Document> getChildren(Document doc)
            throws SessionException;

    public Enumeration<Document> getChildren(Document doc, int lifeCycleState)
            throws SessionException;

    public Enumeration<Document> getChildren(Document doc, int lifeCycleState,
            long count, long index) throws SessionException;

    public Document getDocumentById(String id);

    public Document getDocumentByPath(String path) throws SessionException;

    public Document getDocumentByPathOfIds(String idsPath)
            throws SessionException;

    public List<Permission> listPermissions(Document doc)
            throws SecurityException;

    public Document getRoot() throws SessionException, SecurityException;

    public Document newDocument(String type) throws SessionException;

    public boolean isValid();

    public void close() throws SessionException, SecurityException;
}
